package com.sc.userspringboot.service.impl;

import com.sc.userspringboot.pojo.Posts;
import com.sc.userspringboot.dao.IPostsDao;
import com.sc.userspringboot.service.IPostsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import org.springframework.stereotype.Service;


/**
 * <p>
 * 用户发布帖子主表 服务实现类
 * </p>
 *
 * @author user
 * @since 2025-09-19 06:25:46
 */
@Service
public class PostsServiceImpl extends ServiceImpl<IPostsDao, Posts> implements IPostsService {

    @Autowired
    private IPostsDao postsDao;
    @Override
    public List<Posts> selectRandomPosts(int limit) {

        return baseMapper.selectRandomPosts(limit);
    }

    @Override
    public List<Posts> getByPostId() {
        return postsDao.getByPostId();
    }

    @Override
    public List<Posts> getByPostId_limit(int limit) {
        return postsDao.getByPostId_limit( limit);
    }

    @Override
    public Posts getByPostId_id(Integer postId) {
        return postsDao.getByPostId_id(postId);
    }

    @Override
    public List<Posts> getUserPosts(List<Integer> postIds) {
        return postsDao.selectBatchIds(postIds);
    }

    @Override
    public List<Posts> getUserPostsAndAuthor(List<Integer> postIds) {
        return postsDao.getUserPostsAndAuthor(postIds);
    }

    @Override
    public List<Posts> getSort() {
        return postsDao.getSort();
    }

    @Override
    public List<Posts> getGamesId(Integer gameId, Integer page) {
        return postsDao.getGamesId(gameId, page);
    }

    @Override
    public List<Posts> getPublishTime(Integer page) {
        return postsDao.getPublishTime(page);
    }
}
